What could be causing the ValueError: setting an array element with a sequence in your numpy code